<?php
namespace app\firm\model;

use think\Model;
use traits\model\SoftDelete;

class ProjectBank extends Model {
    
     protected $autoWriteTimestamp = true;

    use SoftDelete;

    protected $deleteTime = 'delete_time';

    /*
     * 查询企业用户银行卡信息
     * @param $where where
     * @param $field field
     * @author cpy(1442435897@qq.com)
     */
    public function getLastBankInfo($where,$field = '*',$order='') {
        $res = $this->field($field)->where($where)->order($order)->find();
        return empty($res)?array():$res->toArray();
    }

    /*
    * 查询企业用户银行卡信息
    * @param $where where
    * @param $field field
    * @author cpy(1442435897@qq.com)
    */
    public function getBankInfo($where,$field = '*') {
        $res = $this->field($field)->where($where)->find();
        return empty($res)?array():$res->toArray();
    }

    
    /*
     * 查询所有企业用户银行卡
     * @param $where where
     * @param $field field
     * @author cpy(1442435897@qq.com)
     */
    public function selectBankInfo($where,$field = '*') {
        $res = $this->field($field)->where($where)->order('create_time desc')->select();
        return empty($res)?array():$res->toArray();
    }

}
